﻿/*请求loading控制*/

var loadModule = angular.module('loadModule', []);
// loadModule.directive('loading', function () {
//     return {
//         restrict: 'EA',
//         replace: true,
//         transclude: true,
//         scope: {loadShowMe:'='},
//         template: '<div><img src="/images/loading.gif" ng-show="loadShowMe" /></div>'
//     }
// });

loadModule.directive('loading', function(){
    return {
        scope:{
            isloading:'=isloading'
        },
        transclude:true,
        replace:true,
        //template:"<div ng-show='isloading'  class='jisupeixun_loding' ><img ng-src='/images/loading.gif' /></div>",
        template:'<!--loading全局--><div ng-show="isloading"><!--<div class="loading_bg"></div>--><div class="loading"><span></span> <span></span>  <span></span>  <span></span> <span></span></div></div>',
        restrict: 'AE', // E = Element, A = Attribute, C = Class, M = Comment                
      }
});

loadModule.directive('btnloading', function(){
    return {
        scope:{
            isbtnload:'=isbtnload'
        },
    transclude:true,
    replace:true,
    template:"<div ng-show='isbtnload'><img ng-src='/images/btnloading.gif' /></div>",
        restrict: 'AEC', // E = Element, A = Attribute, C = Class, M = Comment
      }
});


// loadModule.directive("btnloading", function () {
//     return {
//        restrice: "AE",
//        scope: true,
//        template:"<div ng-show='isloading'><img ng-src='/images/btnloading.gif' /></div>",
////        link: function (scope, element, attr) {          
////            element[0].innerHTML = "<img ng-src='/images/btnloading.gif' />";
////     }
//    }
//});
